home *** CD-ROM | disk | FTP | other *** search
- ;CEH.ASM -- DOS Critical Error Handler for use with
- ; Microsoft QB 4.x, PDS 7.x & VB/DOS 1.x.
-
- .Model Medium, Basic
-
- .Data
- ErrCode DW ? ;Critical error code
- OldInt24 DW ?,? ;Original int vector
-
- .Code
- Proc InstallCEH Uses DS ES
-
- Push SS ;Make sure DS points
- Pop DS ;to DGROUP
- Mov ErrCode, 0FFFFh ;Initialize ErrCode
-
- Mov AX, 3524h
- Int 21h ;Get original vector
- Mov OldInt24, BX ;Save it in OldInt24
- Mov OldInt24[2], ES
-
- Mov AX, Seg CEH ;Point int vector
- Mov DS, AX ;to our CEH routine
- Mov DX, Offset CEH
- Mov AX, 2524h
- Int 21h
- Ret
-
- InstallCEH Endp
- Proc RemoveCEH Uses DS
-
- Lds DX, DWord Ptr OldInt24
- Mov AX, 2524h ;Restore original
- Int 21h ;int 24h vector
- Ret ;and exit
-
- RemoveCEH Endp
- Proc CEHError
-
- Mov AX, ErrCode ;Return value of ErrCode
- Ret ;to calling program
-
- CEHError Endp
- CEH Proc Far
-
- Push SS ;Make sure DS points
- Pop DS ;to DGROUP
- Sti ;Enable interrupts
- Mov AX, DI ;Put DI into AX
- Xor AH, AH ;Clear high byte
- Mov ErrCode, AX ;and save low byte in ErrCode
- Xor AL, AL ;Tell DOS to ignore error
- Stc ;Set carry flag
- IRet ;and return
-
- CEH Endp
- End
-
-